package com.hkyp.ss.course.provider.model;


import com.hkyp.ss.course.provider.model.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Description: 后台用户信息表
 * @Author:
 * @CreateDate: 2018/7/18 14:25
 */
@Data
@Entity
@EqualsAndHashCode(callSuper=true)
@DynamicUpdate
@DynamicInsert
@Table()
public class AdminUser extends BaseEntity {

    private static final long serialVersionUID = 201L;


    /**
     *  关联的普通用户id
     */
    @Column(name = "user_id")
    private String userId;
    /**
     * 用户昵称
     * 字段长度15
     * 需求限制长度在2-14字符之间
     */
    @Column(name = "nick_name", length = 15)
    private String nickName;


    /**
     * 头像
     * 存储头像上传到OSS后返回的url
     */
    @Column(name = "avatar", length = 500)
    private String avatar;

    /**
     * 邮箱
     * 字段长度20
     * 需进行格式校验
     */
    @Column(name = "email", length = 20)
    private String email;


    /**
     * 密码
     */
    @Column(length = 40)
    private String password;



    /**
     * 用户状态
     * 默认值为1
     * 1：冻结；  0：正常，2/3.邮箱未激活  10 逻辑删除
     */
    @Column(name = "status", columnDefinition = "tinyint")
    private Integer status = 0;


}


